/* eslint-disable */
import request from "@/request";

/** addComment POST /api/api/product/comment/add */
export async function addCommentUsingPost1(
  body: API.ProductComment,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>("/api/api/product/comment/add", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** getCommentCount GET /api/api/product/comment/count */
export async function getCommentCountUsingGet1(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getCommentCountUsingGET1Params,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong_>("/api/api/product/comment/count", {
    method: "GET",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** deleteComment POST /api/api/product/comment/delete */
export async function deleteCommentUsingPost1(
  body: API.ProductComment,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>("/api/api/product/comment/delete", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** likeComment POST /api/api/product/comment/like */
export async function likeCommentUsingPost1(
  body: API.ProductComment,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>("/api/api/product/comment/like", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** getProductComments GET /api/api/product/comment/list */
export async function getProductCommentsUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getProductCommentsUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageProductComment_>(
    "/api/api/product/comment/list",
    {
      method: "GET",
      params: {
        // pageNum has a default value: 1
        pageNum: "1",
        // pageSize has a default value: 10
        pageSize: "10",
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** getAllProductComments GET /api/api/product/comment/list/all */
export async function getAllProductCommentsUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getAllProductCommentsUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseListProductComment_>(
    "/api/api/product/comment/list/all",
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** getAverageRating GET /api/api/product/comment/rating */
export async function getAverageRatingUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getAverageRatingUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseDouble_>("/api/api/product/comment/rating", {
    method: "GET",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** getCommentReplies GET /api/api/product/comment/replies */
export async function getCommentRepliesUsingGet1(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getCommentRepliesUsingGET1Params,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseListProductComment_>(
    "/api/api/product/comment/replies",
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** updateComment POST /api/api/product/comment/update */
export async function updateCommentUsingPost1(
  body: API.ProductComment,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>("/api/api/product/comment/update", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** getUserComments GET /api/api/product/comment/user */
export async function getUserCommentsUsingGet(options?: {
  [key: string]: any;
}) {
  return request<API.BaseResponseListProductComment_>(
    "/api/api/product/comment/user",
    {
      method: "GET",
      ...(options || {}),
    }
  );
}
